//
//  JsonChar.m
//  Air
//
//  Created by dongguozheng on 2016/12/8.
//  Copyright © 2016年 董国政. All rights reserved.
//

#import "JsonChar.h"

@implementation JsonChar
- (id)toArrayOrNSDictionary:(NSString *)jsonString {
    if (jsonString == nil) {
        return nil;
    }
    NSError *error = nil;
    NSData *jsonData=[jsonString dataUsingEncoding:NSASCIIStringEncoding];
    id jsonObject = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingAllowFragments error:nil];
    
    if (jsonObject != nil && error == nil){
        return jsonObject;
    }else{
        // 解析错误
        return nil;
    }
}

@end
